package org.flynenu.ums.common.ticket;

import java.util.Date;
import java.util.UUID;

public class UUIDGenerator implements TicketGenerator {
	@Override
	public Ticket generate(TicketParameter parameter) {
		UUID uuid = UUID.randomUUID();
		
		Ticket ticket = new Ticket();
		ticket.setId(parameter.getUid());
		ticket.setCreateTime(new Date());
		ticket.setTicketNo(uuid.toString());
		ticket.setParameter(parameter);
		
		return ticket;
	}

}
